// pages/setUp/shopInfor/shopInfor.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    kind: ["自营", "民营"],
    userKind: '',//性别
    cardFontImg: '',
    trade: [
      { name: "电子商务", selected: false },
      { name: "游戏", selected: false },
      { name: "媒体", selected: false },
      { name: "广告营销", selected: false },
      { name: "数据服务", selected: false },
      { name: "医疗健康", selected: false },
      { name: "生活服务", selected: false },
      { name: "O2O", selected: false },
      { name: "旅游", selected: false },
      { name: "分类信息", selected: false },
      { name: "音乐/视频/阅读", selected: false },
      { name: "在线阅读", selected: false },
      { name: "社交网络", selected: false },
      { name: "人力资源服务", selected: false },
      { name: "企业服务", selected: false },
      { name: "信息安全", selected: false },
      { name: "智能硬件", selected: false },
      { name: "移动互联网", selected: false },
      { name: "物联网", selected: false },
      { name: "计算机软件", selected: false },
      { name: "通信/网络设备", selected: false },
      { name: "广告/公关/会展", selected: false },
      { name: "互联网金融", selected: false },
      { name: "物流/仓储", selected: false },
      { name: "贸易/进出口", selected: false },
      { name: "咨询", selected: false },
      { name: "工程施工", selected: false },
      { name: "汽车生产", selected: false },
      { name: "其他行业", selected: false }
    ],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    this.animation = wx.createAnimation();
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  etimeChange: function (e) {
    let t = e.detail.value
    this.setData({
      wendTime: t
    })
  },
  SexyChange: function (e) {
    console.log(e)
    let i = e.detail.value;
    this.setData({
      userKind: this.data.kind[i]
    })
  },
  // 行业类型
  tradeShow: function (e) {
    console.log(e);
    this.setData({
      isRuleTrue: true
    })
    this.animation.translate(-320, 0).step()
    this.setData({ animation: this.animation.export() })
  },
  selectTrade: function (e) {
    var that = this;
    // console.log(e);
    let indx = e.currentTarget.dataset.index;
    var trade = that.data.trade
    for (let i = 0; i < trade.length; i++) {
      trade[i].selected = false
    }
    let selected = trade[indx].selected;
    trade[indx].selected = !selected
    that.setData({
      con_trade: trade[indx].name,
      trade: trade
    })
    console.log(that.data.trade[indx].selected)
  },
  success: function (e) {
    var val = e.currentTarget.dataset.val
    this.setData({
      isRuleTrue: false,
      selectedTrade: val
    })
    this.animation.translate(320, 0).step()
    this.setData({ animation: this.animation.export() })
  },
  chongzhi: function (e) {
    console.log(e);
    var cate = this.data.trade;
    console.log(cate);
    for (let i = 0; i < cate.length; i++) {
      cate[i].selected = false;
    }
    this.setData({
      trade: cate,
      con_trade: ''
    })
  },
})